import React,{useRef, useState,useEffect} from 'react'
import { useRoutes} from 'react-router-dom'
import routes from './router/index'
export default function App() {
  //利用ref修改变量 中间变量
  const numRef = useRef(100);
  // const [num,setNum] = useState(100)
  const [num,setNum] = useState(numRef.current)


  return (
    <>
    {/* <p>num:{num}</p>
    <button onClick={()=>{
      numRef.current = num+1;
      setNum(numRef.current)
      // console.log('num',num);
      console.log(numRef);
    }}>++</button> */}
      { useRoutes(routes)}  


    </>
  )
}
